import QtQuick 2.15
import QtCharts 2.15

ChartView {
    id: chartView
    title: "热力图"
    antialiasing: true
    
    function generateRandomData(rows, cols, maxValue) {
        var data = []
        for (var i = 0; i < rows; i++) {
            var row = []
            for (var j = 0; j < cols; j++) {
                row.push(Math.random() * maxValue)
            }
            data.push(row)
        }
        return data
    }
    
    Component.onCompleted: {
        var data = generateRandomData(5, 5, 100)
        for (var i = 0; i < data.length; i++) {
            for (var j = 0; j < data[i].length; j++) {
                scatterSeries.append(i * 20, j * 20)
            }
        }
    }
    
    ScatterSeries {
        id: scatterSeries
        name: "HeatMap"
        markerSize: 15
        axisX: axisX
        axisY: axisY
    }
    
    ValueAxis {
        id: axisX
        min: 0
        max: 100
    }
    
    ValueAxis {
        id: axisY
        min: 0
        max: 100
    }
}

